<template>
  <div>
    <el-card class="box-1">
      <div slot="header"><span>新闻详情</span></div>
      <div class="vhtml" v-html="info.content">{{ info.content }}</div>
    </el-card>
  </div>
</template>

<script>
export default {
  data() {
    return {
      title: '',
      info: {}
    }
  },
  watch: {},
  created() {
    this.title = this.$route.query.title
    if (this.$route.query.id) {
      this.id = this.$route.query.id
      this.getNews(this.$route.query.id)
    }
  },
  methods: {
    getNews(id) {
      const url = 'lookarticles/view/' + id
      this.$store.dispatch('GetConnect', { url }).then(res => {
        this.info = res.data
      }).catch(e => {
        this.$message.error(e.msg + ',请刷新或联系管理员')
      })
    }
  }
}
</script>

<style lang="scss" type="text/scss" scoped>
@import '../../../styles/index.scss';
.box-1 {
  max-width: 1000px;
  margin: 0 auto;
  > div span {
    font-size: 18px;
    font-weight: 600;
    padding: 0 10px;
  }
}
</style>
